home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / SimpleServer / modDPlayServer.bas < prev    next >
BASIC Source File  |  2001-10-08  |  2KB  |  67 lines

  1. Attribute VB_Name = "modDPlayServer"
  2. Option Explicit
  3. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. '
  5. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  6. '
  7. '  File:       modDPlayServer.bas
  8. '
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10.  
  11. Public Const AppGuid = "{5726CF1F-702B-4008-98BC-BF9C95F9E288}"
  12. Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
  13.  
  14. Public Type NOTIFYICONDATA
  15.     cbSize As Long
  16.     hwnd As Long
  17.     uID As Long
  18.     uFlags As Long
  19.     uCallbackMessage As Long
  20.     hIcon As Long
  21.     sTip As String * 64
  22. End Type
  23.     
  24. Public Const NIM_ADD = &H0
  25. Public Const NIM_MODIFY = &H1
  26. Public Const NIM_DELETE = &H2
  27. Public Const NIF_MESSAGE = &H1
  28. Public Const NIF_ICON = &H2
  29. Public Const NIF_TIP = &H4
  30. Public Const NIF_DOALL = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
  31. Public Const WM_MOUSEMOVE = &H200
  32. Public Const WM_LBUTTONDBLCLK = &H203
  33. Public Const WM_RBUTTONUP = &H205
  34.  
  35.  
  36. Public dx As New DirectX8
  37. Public dps As DirectPlay8Server
  38. Public dpa As DirectPlay8Address
  39. Public glNumPlayers As Long
  40. Public gfStarted As Boolean
  41. Public sysIcon As NOTIFYICONDATA
  42.  
  43. Public Sub Main()
  44.  
  45.     InitDPlay
  46.     frmServer.Show
  47. End Sub
  48.  
  49. Public Sub InitDPlay()
  50.  
  51.     Set dps = dx.DirectPlayServerCreate
  52.     Set dpa = dx.DirectPlayAddressCreate
  53.     
  54. End Sub
  55.  
  56. Public Sub Cleanup()
  57.  
  58.     'Shut down our message handler
  59.     If Not dps Is Nothing Then dps.UnRegisterMessageHandler
  60.     'Close down our session
  61.     If Not dps Is Nothing Then dps.Close
  62.     Set dps = Nothing
  63.     Set dpa = Nothing
  64.     Set dx = Nothing
  65.     
  66. End Sub
  67.